function isFilled(elm) {
    if (elm.value == "" || elm.value == null)
        return false;
    else
        return true;
}

function isReady() {
    msg="";
    
	// alert($('input[name=paytype]:checked').val())
    // alert(document.pay.paytype.options[document.pay.category_selectlist.selectedIndex].value));
    // if (isFilled(document.pay.cardExpiration) == false) {
    // msg=msg+"Card Expiration\n";
    // }
    if (isFilled(document.pay.email) == false) {
        msg=msg+"Email\n";
    }
    if ($('input[name=paytype]:checked').val() == 1) {
        if (isFilled(document.pay.firstname) == false) {
            msg=msg+"First Name\n";
        }
        if (isFilled(document.pay.lastname) == false) {
            msg=msg+"Last Name\n";
        }
        if (isFilled(document.pay.address) == false) {
            msg=msg+"Address\n";
        }
        if (isFilled(document.pay.city) == false) {
            msg=msg+"city\n";
        }
        if (isFilled(document.pay.state) == false) {
            msg=msg+"state\n";
        }
        if (isFilled(document.pay.zip) == false) {
            msg=msg+"zip\n";
        }
        if (isFilled(document.pay.phone) == false) {
            msg=msg+"Phone\n";
        }
        if (isFilled(document.pay.cardName) == false) {
            msg=msg+"Card Name\n";
        }
        if (isFilled(document.pay.cardNumber) == false) {
            msg=msg+"Card Number\n";
        }
        if (isFilled(document.pay.cardSecurityNumber) == false) {
            msg=msg+"Card Cecurity Number\n";
        }
    }
    if (isFilled(document.pay.amount) == false) {
        msg=msg+"Amount\n";
    }
    
    if (document.pay.category.selectedIndex == '0') {
        msg=msg+"Select a Payment Type\n";
    }
    if( msg != "" ) {
        alert("Please fill in the required fields:\n"+msg);
        return false;
    }
    return true;
}

function setfocus() {
    document.document.pay.email.focus()
}

//function changed(){
//    alert(document.pay.category_selectlist.options[document.pay.category_selectlist.selectedIndex].value);
//    alert(document.pay.category_selectlist.selectedIndex);
//}